<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>会员中心-一览网</title>
    <link rel="stylesheet" href="css/common.css">
    <link rel="stylesheet" href="css/member.css">
    <script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
    <script type="text/javascript" src="js/layui/layui.all.js"></script>
</head>
<body>
<header>
    <div class="m_top">
        <div class="m_top_bar">
            <div class="m_top_login fl">
                <p><b>13814503433</b> <img src="images/right.png">  <a href="member_index.html">会员中心</a> | <a href="">退出</a></p>
            </div>
            <div class="m_top_search fl">
                <form method="get" action="">
                    <div class="m_search_warp">
                        <i class="ico ico-zoom"></i>
                        <input type="text" value="" placeholder="请输入化学品的中文名，英文名或CAS号" class="m_search_txt">
                    </div>
                    <input type="submit" value="搜索" class="m_search_sub">
                </form>
            </div>
            <div class="m_top_nav rg_menu fr">
                <ul>
                    <li><a href="index.html">平台首页</a><span>|</span></li>
                    <li><div class="show_qrcode"> <img src="images/er-icon.png" class="simple">二维码 <span>|</span><div class="tip-qrcode"><img src="images/qrcode.jpg"></div></div></li>
                    <li class="kf"><a href="javascript:;" class="td">客服中心</a><span>|</span>
                        <div class="kf_child hidden">
                            <ul>
                                <li><a href="help.html">帮助中心</a> </li>
                                <li><a href="feedback.html">反馈意见</a> </li>
                                <li><a href="contact.html">联系我们</a> </li>
                            </ul>
                        </div>
                    </li>
                    <li><a href=""  class="td">网站地图</a></li>
                </ul>
            </div>
        </div>
    </div>
</header>

<div class="clearfix"></div>

<div class="contain pt20">
    <div class="m_content">
        <div class="m_menu fl">
            <div class="mt_menu">
                <dl>
                    <dt class="mn1">会员首页</dt>
                    <dd><a href="member_index.html">会员首页</a></dd>
                </dl>
                <dl>
                    <dt class="mn2">采购中心</dt>
                    <dd><a href="member_buy_add.html">新增求购</a></dd>
                    <dd>
                        <a href="member_buy_list.html">求购管理</a>
                        <ol class="hidden">
                            <li><a href="">已报价</a></li>
                            <li><a href="">未报价</a></li>
                            <li><a href="">取消求购</a></li>
                            <li><a href="">暂时缺货</a></li>
                        </ol>
                    </dd>
                    <dd><a href="member_order_list.html">采购订单</a></dd>
                </dl>
                <dl>
                    <dt class="mn3">销售中心</dt>
                    <dd><a href="member_goods_add.html">上传目录</a></dd>
                    <dd><a href="member_goods_list.html">商品管理</a>
                        <ol class="hidden">
                            <li><a href="member_goods_list.html">已上架</a></li>
                            <li><a href="member_goods_list_down.html">已下架</a></li>
                            <li><a href="member_goods_list_check.html">待审核</a></li>
                        </ol>
                    </dd>
                    <dd><a href="member_inquiry_list.html">询单管理</a>
                        <ol>
                            <li class="on"><a href="member_inquiry_list.html">未报价</a></li>
                            <li><a href="member_inquiry_list_had.html">已报价</a></li>
                            <li><a href="member_inquiry_list_abandon.html">已放弃</a></li>
                        </ol>
                    </dd>
                    <dd><a href="">销售订单</a></dd>
                </dl>
                <dl>
                    <dt class="mn4">账号管理</dt>
                    <dd><a href="">我的关注</a></dd>
                    <dd><a href="">账号信息</a></dd>
                    <dd><a href="">交易资料</a></dd>
                </dl>
            </div>
        </div>
        <div class="m_con fr">
            <div class="b-bar">
                <div class="b-title"><span>添加报价</span></div>
                <div class="b-con">

                    <div class="inqadd_info mt20 mb10">
                        <p>
                            <i class="information"></i>
                            <span>128-08-5</span>
                            <span>N-溴代丁二酰亚胺</span>
                            <span> 20kg </span>
                            <span class="red">增值税发票(13%)</span>
                            <span>2020-11-27 13:54:35</span>
                        </p>
                        <p>
                            <i class="car"></i>发货到：<span class="red">江苏省 </span>
                            <span><i class="remark_icon"></i>备注：</span>
                        </p>
                    </div>

                    <form id="add_form" action="" accept-charset="UTF-8" data-remote="true" method="post">
                        <div class="add_quote_con">
                            <div class="flex mt20 mb20">
                               <span style="display: inline-block;float: left;line-height: 34px;margin-right: 20px;font-size: 14px;color: #666;">外观:</span>
                               <div class="select hidden">
                                    <select name="quotation[appear_light]" id="quotation_appear_light" tabindex="-1" style="border:#e0e0e0 solid 1px;padding:5px 15px;">
                                        <option value="">选择亮度</option>
                                        <option value="淡">淡</option>
                                        <option value="深">深</option>
                                    </select>
                                </div>
                                <div class="select mr20">
                                    <select name="quotation[appear_color]" id="quotation_appear_color" tabindex="-1" style="border:#e0e0e0 solid 1px;padding:5px 15px;">
                                        <option value="">选择颜色</option>
                                        <option value="白色">白色</option>
                                        <option value="米白色">米白色</option>
                                        <option value="无色/透明">无色/透明</option>
                                        <option value="棕色/褐色">棕色/褐色</option>
                                        <option value="黄色">黄色</option>
                                        <option value="桔黄色">桔黄色</option>
                                        <option value="暗黑色">暗黑色</option>
                                        <option value="深色">深色</option>
                                        <option value="金色">金色</option>
                                        <option value="灰色">灰色</option>
                                        <option value="绿色">绿色</option>
                                        <option value="灰白色">灰白色</option>
                                        <option value="橙色">橙色</option>
                                        <option value="苍白色">苍白色</option>
                                        <option value="粉红色">粉红色</option>
                                        <option value="紫色">紫色</option>
                                        <option value="红色">红色</option>
                                        <option value="褐色">褐色</option>
                                        <option value="灰褐色">灰褐色</option>
                                        <option value="朱红色">朱红色</option>
                                        <option value="鲜绿色">鲜绿色</option>
                                        <option value="淡蓝色">淡蓝色</option>
                                        <option value="黑色">黑色</option>
                                        <option value="蓝色">蓝色</option>
                                        <option value="亮绿">亮绿</option>
                                    </select>
                                </div>
                                <div class="select mr20">
                                    <select name="quotation[appear_shape]" id="quotation_appear_shape" tabindex="-1" style="border:#e0e0e0 solid 1px;padding:5px 15px;">
                                        <option value="">选择性状</option>
                                        <option value="固体">固体</option>
                                        <option value="液体">液体</option>
                                        <option value="油">油</option>
                                        <option value="晶体">晶体</option>
                                        <option value="粉末">粉末</option>
                                    </select>
                                </div>
                            </div>

                            <div class="clearfix"></div>
                            <div class="quot_con">
                                <table class="quot_table">
                                    <thead>
                                    <tr>
                                        <th width="10%">是否定制</th>
                                        <th width="10%">包装</th>
                                        <th width="10%">规格</th>
                                        <th width="12%">总价</th>
                                        <th width="12%">运费</th>
                                        <th width="5%">纯度</th>
                                        <th width="5%">备货天数</th>
                                        <th width="5%">货号</th>
                                        <th width="13%">配送方式</th>
                                        <th width="20%">开票类型</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr>
                                        <td>
                                            <select class="select optional" name="details[0][customization_type]" id="details_0_customization_type" tabindex="-1" style="border:#e0e0e0 solid 1px;padding:5px 15px;">
                                                <option selected="selected" value="现货">现货</option>
                                                <option value="定制">定制</option>
                                            </select>
                                        </td>
                                        <td>
                                            <input style="text-align: center;" type="number" step="any" value="20" name="details[0][package]" id="details_0_package">
                                        </td>
                                        <td>
                                            <select name="details[0][package_unit]" id="details_0_package_unit" tabindex="-1" style="border:#e0e0e0 solid 1px;padding:5px 15px;">
                                                <option value="mg">mg</option>
                                                <option value="g">g</option>
                                                <option value="kg" selected="">kg</option>
                                                <option value="ml">ml</option>
                                                <option value="l">l</option>
                                                <option value="ton">ton</option>
                                            </select>
                                        </td>
                                        <td><input type="number" step="any" name="details[0][vendor_price]"></td>
                                        <td><input type="number" step="any" name="details[0][shipping_fee]" id="details_0_shipping_fee"></td>
                                        <td><input class="center" type="text" name="details[0][purity]" id="details_0_purity"></td>
                                        <td><input class="center" type="number" step="1" name="details[0][etd]" id="details_0_etd"></td>
                                        <td><input class="center" type="text" name="details[0][art_no]" id="details_0_art_no"></td>
                                        <td>
                                            <select name="details[0][ship_method]" id="details_0_ship_method" tabindex="-1" style="border:#e0e0e0 solid 1px;padding:5px;">
                                                <option value="1">快递到门</option>
                                                <option value="2">物流自提</option>
                                                <option value="3">送货上门</option>
                                            </select>
                                        </td>
                                        <td>
                                            <select name="details[0][vendor_invoice_type]" id="details_0_vendor_invoice_type" tabindex="-1" style="border:#e0e0e0 solid 1px;padding:5px 0px;">
                                                <option value="1">增值税发票(13%)</option>
                                                增值税发票(13%)
                                                <option value="2">增值税发票(普通)</option>
                                                增值税发票(普通)
                                                <option value="3">不含税</option>
                                                不含税
                                            </select>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                                <div class="beizhu">
                                    <p><span style="font-size: 14px;">报价备注</span></p>
                                    <textarea rows="3" class="comment" placeholder="请注意发票类型要符合客户需求，否则该报价可能不被客户引用，如不符合必须在备注写明原因。" name="quotation[note]" id="quotation_note"></textarea>
                                </div>
                                <div class="clearfix"></div>
                                <div class="a-center">
                                    <button class="submit_btn wd100" onclick="javascript:void(0);" id="submit_button">立即报价</button>
                                </div>
                            </div>

                        </div>
                    </form>

                </div>
            </div>

        </div>
    </div>
    <div class="clearfix"></div>
</div>
<div class="clearfix"></div>
<footer>
    <div class="footer">
        <div class="foot_con">
            <div class="ft_left">
                <div class="ft_service">
                    <img src="images/service.png">
                    <p class="yellow fz16 bold mt10">电话：025-66028182</p>
                    <p class="fz16 mt10">QQ：2850281398</p>
                    <p class="fz16 mt10">工作时间 8:30 - 17:30</p>
                </div>
            </div>
            <div class="ft_center">
                <dl>
                    <dt>新手上路</dt>
                    <dd><a href="">用户注册</a></dd>
                    <dd><a href="">隐私声明</a></dd>
                    <dd><a href="">使用须知</a></dd>
                    <dd><a href="">协议条款</a></dd>
                </dl>
                <dl>
                    <dt>联系我们</dt>
                    <dd><a href="">关于我们</a></dd>
                    <dd><a href="">联系我们</a></dd>
                    <dd><a href="">合作伙伴</a></dd>
                    <dd><a href="">通知公告</a></dd>
                </dl>
                <dl>
                    <dt>售后服务</dt>
                    <dd><a href="">开票服务</a></dd>
                    <dd><a href="">退换货服务</a></dd>
                    <dd><a href="">用户反馈</a></dd>
                    <dd><a href="">发货方式</a></dd>
                </dl>
                <dl>
                    <dt>帮助中心</dt>
                    <dd><a href="">售后政策</a></dd>
                    <dd><a href="">退换货说明</a></dd>
                    <dd><a href="">退款说明</a></dd>
                    <dd><a href="">产品目录</a></dd>
                </dl>
            </div>
            <div class="ft_right">
                <div class="ft_qrcode">
                    <img src="images/qrcode.jpg">
                    <p>关注公众号</p>
                </div>
            </div>
        </div>
        <div class="clearfix"></div>
        <div class="copyright">
            <p>版权所有 Copyright(C)2020 南京一览生物科技有限公司 <a href="http://www.beian.miit.gov.cn/" style="color: #777272;">苏ICP备20017967号-1</a></p>
        </div>
    </div>
    <div class="clearfix"></div>
</footer>
<div class="hidden" id="template">
    <div class="flex b_inq_item">
        <div class="flex b_inq_item_c">
            <div><input class="form_input" alis="input_cas" name="inquiry[cas][]" placeholder="请输入CAS号码" type="text" value=""></div>
            <div>
                <input class="form_input wd80" alis="input_package1" name="inquiry[package1][]" placeholder="数量1" type="number" value="" min="0" autocomplete="off">
                <select class="form_select" name="inquiry[package1_unit][]" alis="input_package1_unit" tabindex="-1">
                    <option value="">单位</option>
                    <option value="1">mg</option>
                    <option value="2">g</option>
                    <option value="3">kg</option>
                    <option value="4">ml</option>
                    <option value="5">l</option>
                    <option value="6">ton</option>
                </select>
            </div>
            <div>
                <input class="form_input wd90" alis="input_package2" name="inquiry[package2][]" type="number" value="" min="0" placeholder="数量2(选填)" autocomplete="off">
                <select class="form_select" name="inquiry[package2_unit][]" alis="input_package2_unit" tabindex="-1">
                    <option value="">单位</option>
                    <option value="1">mg</option>
                    <option value="2">g</option>
                    <option value="3">kg</option>
                    <option value="4">ml</option>
                    <option value="5">l</option>
                    <option value="6">ton</option>
                </select>
            </div>
            <div><textarea class="form_textarea" name="inquiry[note][]" cols="20" rows="2"></textarea></div>
            <div><a href="javascript:void(0);" class="blue_btn" name="delete">删除</a></div>
        </div>
        <div class="b_inq_name">二碳酸二叔丁酯Di-tert-butyl dicarbonate</div>
    </div>
</div>
</body>
</html>
<script type="text/javascript">
    $("#submit_button").click(function () {
        var res =  form_valid();
        if(res != 'success'){
            layer.alert(res,{
                skin: 'layui-layer-lan',
                anim: 4
            });
            return false;
        }
        submit_quotation_form();
    });

    //提交表单
    function submit_quotation_form() {
        $.ajax({
            url: $("#add_form").attr('action'),
            data: $("#add_form").serializeArray(),
            type: 'post',
            cache: false,
            dataType: 'json',
            success: function (data) {
                layer.alert(data.msg, {
                    skin: 'layui-layer-lan' //样式类名
                    ,closeBtn: 0
                    ,anim: 4
                }, function(){
                    window.location.href = 'http://old.chemicalseller.cn/member/sell/detail_quotation?id=863624';
                });
            },
            error: function () {
                layer.alert('系统异常，请联系客服人员！', {
                    skin: 'layui-layer-lan' //样式类名
                    ,closeBtn: 0
                    ,anim: 4
                });
            }
        });
    }

    function form_valid(){
        var flag = 'success'
        // 判断包装
        $("input[name$='[package]']").each(function(){
            var _package = parseInt($(this).val());
            if(isNaN(_package) || _package < 0){
                flag = '请输入合法的包装。'
            }
        });
        if(flag != 'success'){
            return flag;
        }
        // 判断价格
        var price_flag = false;
        $("input[name$='[vendor_price]']").each(function(){
            var _price = parseInt($(this).val());
            if(_price > 0){
                price_flag = true;
                if($.trim($(this).parents("tr").find("input[name$='[purity]']").val()) == ''){
                    flag = '请输入纯度。'
                }
                if($.trim($(this).parents("tr").find("input[name$='[etd]']").val()) == ''){
                    flag = '请输入备货天数。'
                }
            }else if(isNaN(price_flag) || _price < 0 ){
                flag = '请输入合法的价格。'
            }
        });
        if(!price_flag){
            flag = '至少输入一个合法的报价。'
        }
        return flag
    }
</script>